/*******************************************************************************
 * Copyright (c) 2011 LegSem.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl-3.0.txt
 * 
 * Contributors:
 *     LegSem - initial API and implementation
 ******************************************************************************/
package com.legstar.eci.xmi.model;

import java.util.ArrayList;
import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

public class XMI {

    @XStreamAsAttribute
    private String version;

    @XStreamImplicit()
    private List < TypeDescriptorMap > typeDescriptorMaps = new ArrayList < TypeDescriptorMap >();

    @XStreamImplicit()
    private List < AggregateInstanceTD > aggregateInstanceTDs = new ArrayList < AggregateInstanceTD >();

    @XStreamImplicit()
    private List < SimpleInstanceTD > simpleInstanceTDs = new ArrayList < SimpleInstanceTD >();

    @XStreamImplicit()
    private List < PlatformCompilerInfo > platformCompilerInfos = new ArrayList < PlatformCompilerInfo >();

    @XStreamImplicit()
    private List < StringTD > stringTDs = new ArrayList < StringTD >();

    @XStreamImplicit()
    private List < PackedDecimalTD > packedDecimalTDs = new ArrayList < PackedDecimalTD >();

    @XStreamImplicit()
    private List < IntegerTD > integerTDs = new ArrayList < IntegerTD >();

    @XStreamImplicit()
    private List < ExternalDecimalTD > externalDecimalTDs = new ArrayList < ExternalDecimalTD >();

    public void add(TypeDescriptorMap typeDescriptorMap) {
        typeDescriptorMaps.add(typeDescriptorMap);
    }

    public void add(AggregateInstanceTD aggregateInstanceTD) {
        aggregateInstanceTDs.add(aggregateInstanceTD);
    }

    public void add(SimpleInstanceTD simpleInstanceTD) {
        simpleInstanceTDs.add(simpleInstanceTD);
    }

    public void add(PlatformCompilerInfo platformCompilerInfo) {
        platformCompilerInfos.add(platformCompilerInfo);
    }

    public void add(StringTD stringTD) {
        stringTDs.add(stringTD);
    }

    public void add(PackedDecimalTD packedDecimalTD) {
        packedDecimalTDs.add(packedDecimalTD);
    }

    public void add(IntegerTD integerTD) {
        integerTDs.add(integerTD);
    }

    public void add(ExternalDecimalTD externalDecimalTD) {
        externalDecimalTDs.add(externalDecimalTD);
    }

    /** {@inheritDoc} */
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("[");
        sb.append("version" + ":" + version + "");
        sb.append(",");
        sb.append("typeDescriptorMaps" + ":" + typeDescriptorMaps + "");
        sb.append(",");
        sb.append("aggregateInstanceTDs" + ":" + aggregateInstanceTDs + "");
        sb.append(",");
        sb.append("simpleInstanceTDs" + ":" + simpleInstanceTDs + "");
        sb.append(",");
        sb.append("platformCompilerInfos" + ":" + platformCompilerInfos + "");
        sb.append(",");
        sb.append("stringTDs" + ":" + stringTDs + "");
        sb.append(",");
        sb.append("packedDecimalTDs" + ":" + packedDecimalTDs + "");
        sb.append(",");
        sb.append("integerTDs" + ":" + integerTDs + "");
        sb.append(",");
        sb.append("externalDecimalTDs" + ":" + externalDecimalTDs + "");
        sb.append("]");
        return sb.toString();
    }

    /**
     * @return the typeDescriptorMaps
     */
    public List < TypeDescriptorMap > getTypeDescriptorMaps() {
        return typeDescriptorMaps;
    }

    /**
     * @return the aggregateInstanceTDs
     */
    public List < AggregateInstanceTD > getAggregateInstanceTDs() {
        return aggregateInstanceTDs;
    }

    /**
     * @return the simpleInstanceTDs
     */
    public List < SimpleInstanceTD > getSimpleInstanceTDs() {
        return simpleInstanceTDs;
    }

    /**
     * @return the platformCompilerInfos
     */
    public List < PlatformCompilerInfo > getPlatformCompilerInfos() {
        return platformCompilerInfos;
    }

    /**
     * @return the stringTDs
     */
    public List < StringTD > getStringTDs() {
        return stringTDs;
    }

    /**
     * @return the packedDecimalTDs
     */
    public List < PackedDecimalTD > getPackedDecimalTDs() {
        return packedDecimalTDs;
    }

    /**
     * @return the integerTDs
     */
    public List < IntegerTD > getIntegerTDs() {
        return integerTDs;
    }

    /**
     * @return the externalDecimalTDs
     */
    public List < ExternalDecimalTD > getExternalDecimalTDs() {
        return externalDecimalTDs;
    }

    /**
     * @return the version
     */
    public String getVersion() {
        return version;
    }

}
